package dvsdk.db;

import dvsdk.form.Util;

public class BinComboUser {
    private String name;
    private int balance;
    private String inn;
    private String pwdMD5;
    
    private BinComboMUser master;

    public BinComboUser(String name, int balance, String inn) {
        this.name = name;
        this.balance = balance;
        this.inn = inn;
    }

    public BinComboUser(String name, int balance, String inn, String pwd) {
        this.name = name;
        this.balance = balance;
        this.inn = inn;
        this.pwdMD5 = pwd;
        //this.pwdMD5 = Util.getMD5(pwdMD5);
    }

    public BinComboMUser getMaster() {
        return master;
    }

    public void setMaster(BinComboMUser master) {
        this.master = master;
    }

    public int getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }

    public String getInn() {
        return inn;
    }

    public void setInn(String inn) {
        this.inn = inn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwdMD5() {
        return pwdMD5;
    }

    public void setPwdMD5(String pwdMD5) {
        this.pwdMD5 = pwdMD5;
    }
    
    public void setPWD(String str) {
        this.pwdMD5=Util.getMD5(str);
    }
    
    public boolean checkPWD(String pwd){
        return (Util.getMD5(pwd).equals(pwdMD5))?true:false;
    }
}